/**
 * @see [description](https://mp.weixin.qq.com/debug/wxadoc/dev/api/authorize.html#wxauthorizeobject)
 */
export default function authorize(scope: 'scope.userInfo' | 'scope.userLocation' | 'scope.address' | 'scope.invoiceTitle' | 'scope.werun' | 'scope.record' | 'scope.writePhotosAlbum') {
	return new Promise<boolean>((resolve) => {
		wx.authorize({
			scope,
			success() {
				resolve(true);
			},
			fail() {
				resolve(false);
			}
		});
	});
}
